
#ifndef MovingAverageFilter_h
#define MovingAverageFilter_h

#define MAX_DATA_POINTS 20

class MovingAverageFilter {
public:
  //construct without coefs
  void init(unsigned int newDataPointsCount);

  int process(int in);
  int round_process(int in);
private:
  int values[MAX_DATA_POINTS];
  int k; // k stores the index of the current array read to create a circular memory through the array
  short dataPointsCount;
  short init_flag;
  int sum;
};
#endif
